import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'alarm_handle_controller.dart';

class AlarmHandlePage extends StatelessWidget {
  final controller = Get.find<AlarmHandleController>();
  AlarmHandlePage({super.key});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("操作处理"),
      ),
      body: _bodyContent(context),
    );
  }

  Widget _bodyContent(BuildContext context) {
    return Column(
      children: [
        const SizedBox(height: 10),
        BrnRadioInputFormItem(
          isRequire: true,
          title: "事件状态",
          options: const ["处理", "误报"],
          value: "处理",
          onChanged: (oldValue, newValue) {
            if (newValue == "处理") {
              controller.handleType = 1;
            } else {
              controller.handleType = 2;
            }
          },
        ),
        const SizedBox(height: 10),
        BrnTextBlockInputFormItem(
          controller: controller.textEditingController,
          title: "处理意见",
          hint: "请输入处理意见",
          minLines: 3,
          maxLines: 5,
        ),
        const Spacer(),
        _bottomContent(),
      ],
    );
  }

  Widget _bottomContent() {
    return Container(
      padding: const EdgeInsets.fromLTRB(30, 10, 30, 20),
      width: Get.width,
      height: 74,
      // color: Colors.white,
      child: ElevatedButton(
        onPressed: () {
          controller.bottomButtonClick();
        },
        child: const Text("确定"),
      ),
    );
  }
}
